<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/fonts/font-awesome.min.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/appcan.icon.css">
        <link rel="stylesheet" href="css/appcan.control.css">
        <link rel="stylesheet" href="css/base.css">
        <link rel="stylesheet" href="css/media.css"/>
        <link rel="stylesheet" href="css/lczjstyle.css?v=1238"/>
        <style type="text/css">
        #search{
            display: none;
        }
        .btn-img{
          background-image:url('images/zy_jk.png');
          background-position: 95%;
          background-repeat: no-repeat;
          background-size: 30%;
            
        }
        .bdr{
         border: 1px solid red;   
        }
         </style>
    </head>
    <body class="um-vp bc-bg" ontouchstart>
        <div class="ub-ver" id="content">
    <div class=" wtp100 h_100" id="search" style="background-color: rgba(230,230,230,.8);position: fixed; z-index: 9999;">
            <div class="bdr-t"></div>
            <div id="wrap" class="ub-ver ub-ac bcwhite  wtp95 uc-a3 marat0">
                  <div class="pt10 wgt">
                    <div class="ub ub-pc fs9">
                        <div class="pr12 lh20">机场三字代码</div>
                        <h6 class="bl bdr-black bora03 fs9 bl tx-c wtp40 lh20" id="SanZiMa" onclick="setSanZiMa()"></h6>
                    </div>
                </div>
                <div class="pt10 ub ub-pc">     
                        <div class="pr12 lh20 fs9 wgt">出港航满日期</div>
                        <div class="bdr-black bora03 bc-img-r lh20 tx-c fs9" id="startDate" style="width: 9.5em">请选择日期</div>
                        <div class="bdr-black bora03 bc-img-r lh20 tx-c fs9 endD" id="endDate" style=" width: 9.5em;display: none">请选择日期</div>
                     
                </div>
                 
                <div class="pt5 pb5">
                    <div class="ub ub-pc fs9 tx-c cwhite ">
                        <div class="w50 lh25 h25 bc6FCAE9 bora02" id="query">查询</div>
                    </div>
                </div>
           </div>
        </div>        
    <div id="" class="ub wtp100 cwhite bcwhite">
        <div class="bc8EC2DA w35 h30 lh30 tx-c bdr-bw bs-lf">
            <div class="fs11">公司</div>
        </div>
        <div class="ub-f1 bdr-b3EC5F7">
            <div class="ub-ver ub-pj h30 tx-c pt5 c4892AA">
                <div class="ub-f1 tx-c">
                    <div class="ub">
                        <h6 class="fs7 wtp50">DD</h6>
                        <h6 class="fs7 wtp50">ID</h6>
                    </div>
                </div>
                <div class="ub-f1">
                    <div class="ub">
                        <h6 class="fs9 wtp20">联程</h6>
                        <h6 class="fs9 wtp20">分段</h6>
                        <h6 class="fs9 wtp20">联程</h6>
                        <h6 class="fs9 wtp20">分段</h6>
                        <h6 class="fs9 wtp20 tx-l">总数</h6>
                    </div>
                </div>
            </div>
        </div>
        
    </div>
    <div class="ub-ver ht100 wtp100">
        <ul id="list_ul">
           
        </ul>
    </div>
</div>
   
   <script src="js/appcan.js"></script>
   <script src="js/appcan.control.js"></script>
   <script src="js/commo.js"></script>
   <script src="js/selectDate.js?v=1234"></script>
 </body>
  <script>
  var LCZJhttp = appcan.locStorage.getVal('LCZJhttp');
    appcan.ready(function() {
       uexWindow.subscribeChannelNotification('inland', 'onNotification');
         uexWindow.onNotification = function(cb){
           eval(cb);
       };     

     });
     
       var show = true;
    function seacrh(index){
      if(index == 3){
      //console.log(index); 
      if(show){
          
       $('#search').css('display','block');   
       show = false;   
      }else{
        $('#search').css('display','none'); 
        show = true;    
      } 
     
     }
    } 
    
     //查询方法
  $("#query").click(function(){
      //隐藏查询框
      $("#search").css("display","none");
      show = true;
      uexWindow.toast(1,5,"正在查询...",-1);
      
      var szm = $("#SanZiMa").text();
      appcan.locStorage.setVal("SZM",szm.toLocaleUpperCase()); 
      if(!szm){
       uexWindow.closeToast();
       alertts("提示","请输入三字码","确定");
       return;
      }else if($('#startDate').text() == "请选择日期"){
       uexWindow.closeToast();
       alertts("提示","请选择结束时间","确定");  
       return; 
      }else{
          //console.log(LCZJhttp);
          $.ajax({
              url:LCZJhttp+"zyh_queryBasBag",
              type:"POST",
              dataType:"JSON",
              data:{
                airport:szm.toLocaleUpperCase(),
                flightDate:$("#startDate").text()
              },
              success:function(res){
                res = JSON.parse(res);
                //console.log(res.queryBasBag);
                var data = JSON.parse(res.queryBasBag);
               // console.log(data.basBags);
                if(data.basBags && data.basBags.length > 0 && data.basBags != "[]"){
                    
                  queryTransfersDCallBack(data.basBags);  
                }else{
                 uexWindow.toast(1,5,"暂时没有查询到数据...",3000);  
                }
                
                //console.log(JSON.parse(res.queryTransfersD));  
              },
              error:function(err){
               uexWindow.toast(1,5,"网络异常...",3000);  
              }
          })
      }
      
  });
  
  function queryTransfersDCallBack(data){
         var tpl = "";
         data.forEach(function(item){
          
          tpl += '<li>'
                +'<div class="ub cwhite">'
                +'<div class="bc8EC2DA w35 lh25 tx-c bdr-bw ub ub-ac ub-pc htit bs-lf">'
                +'<div class="fs10">'+item.companyName+'</div>'   
                +'</div>'
                +'<div class="ub-f1 c4892AA bcwhite tx-c">'
                +'<div class="ub-ver">'
                +'<div class="ub bdr-b3EC5F7 city_line" companyName="'+item.companyName+'" ddLianChen="'+item.ddLianChen+'" ddFenDuan="'+item.ddFenDuan+'" diTcLianChen="'+item.diTcLianChen+'" diTcFenDuan="'+item.diTcFenDuan+'" diNtcLianChen="'+item.diNtcLianChen+'" diNtcFenDuan="'+item.diNtcFenDuan+'" iiHxLianChen="'+item.iiHxLianChen+'" iiHxFenDuan="'+item.iiHxFenDuan+'" iiNhxLianChen="'+item.iiNhxLianChen+'" iiNhxFenDuan="'+item.iiNhxFenDuan+'" idLianChen="'+item.idLianChen+'" idFenDuan="'+item.idFenDuan+'">'
                +'<div class="ub-f1">'
                +'<div class="ub">'
                +'<div class="h25 lh25 wtp20">'
                +'<div class="fs11">'+item.ddLianChen+'</div>'
                +'</div>'
                +'<div class="h25 lh25 wtp20">'
                +'<div class="fs11">'+item.ddFenDuan+'</div>'
                +'</div>'
                +'<div class="h25 lh25 wtp20">'
                +'<div class="fs11">'+item.idLianChen+'</div>'
                +'</div>'
                +'<div class="h25 lh25 wtp20">'
                +'<div class="fs11">'+item.idFenDuan+'</div>'
                +'</div>'
                +'<div class=" h25 lh25 wtp20 tx-l">'
                +'<div class="fs11 btn-img">'+(item.ddFenDuan+item.ddLianChen+item.idFenDuan+item.idFenDuan)*1+'</div>'
                +'</div>'
                +'</div>'  
                +'</div>'  
                +'</div>'
                +'</div>'
                +'</div>'    
                +'</div>' 
                +'</li>';         
                                  
            +'<div class="btn-img h25 lh25 w15"></div>'
        });
    
     $("#list_ul").html(tpl);
     
     uexWindow.closeToast();
     
     $(".city_line").click(function(){
       
      appcan.locStorage.setVal('companyName',$(this).attr("companyName"));  
      var LianCheng = {};
      //DD联程
      LianCheng.ddLianChen= $(this).attr("ddLianChen");
      //DD分段
      LianCheng.ddFenDuan= $(this).attr("ddFenDuan");
      //DI通程联程
      LianCheng.diTcLianChen = $(this).attr("diTcLianChen"); 
      //DI通程分段
      LianCheng.diTcFenDuan = $(this).attr("diTcFenDuan"); 
      //DI不通程联程
      LianCheng.diNtcLianChen = $(this).attr("diNtcLianChen"); 
      //DI不通程分段
      LianCheng.diNtcFenDuan = $(this).attr("diNtcFenDuan");
      //II第一站是航信联程
      LianCheng.iiHxLianChen = $(this).attr("iiHxLianChen");
      //II第一站是航信分段
      LianCheng.iiHxFenDuan = $(this).attr("iiHxFenDuan");
      //II第一站不是航信联程
      LianCheng.iiNhxLianChen = $(this).attr("iiNhxLianChen");
      //II第一站不是航信分段
      LianCheng.iiNhxFenDuan = $(this).attr("iiNhxFenDuan");
      //ID联程
      LianCheng.idLianChen = $(this).attr("idLianChen");
      //ID分段
      LianCheng.idFenDuan = $(this).attr("idFenDuan");
      
      //储存联程信息数据
      appcan.locStorage.setVal('LianChengOBj',JSON.stringify(LianCheng));
      
      appcan.window.open({
         name: "transitDetail",
         dataType: 0,
         aniId: 5,
         data: "transitDetail.html",   
        })
     });
  }
  
  function setSanZiMa(){
      var evaluate = {};
      evaluate.windowName = "connectingFlight";
      evaluate.popName = "content";
      evaluate.pageName = "transit";
      evaluate.type = 0;
      appcan.locStorage.setVal("evaluateObj",JSON.stringify(evaluate));
      appcan.window.open('LCairport_select1', 'LCairport_select1.html', '2', '4', 0, 0, 200);
  }
  
  function setAirPort(code){
      
      $("#SanZiMa").text(code);
  }
  
  //提示框
  function alertts(t, c, b) {
             
            appcan.window.alert({
                title : t,
                content : c,
                buttons : b
            });
        } 
     
  </script>
</html>